
with open('file.py', 'r') as file:
    code = file.read()

    namespace = {"haha": None}

    exec(code, namespace)

    result = namespace["result"]

    print(result)  # 输出 52


